package com.chezhujie.www.core;

import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.support.WebBindingInitializer;
import org.springframework.web.context.request.WebRequest;

import java.util.Date;

/**
 * 数据绑定初始化类
 * 
 * 
 */
public class BindingInitializer implements WebBindingInitializer {
	/**
	 * 初始化数据绑定
	 */
	public void initBinder(WebDataBinder binder, WebRequest request) {
		binder.registerCustomEditor(Date.class, new DateTypeEditor());
		//        binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"), true));
//        binder.registerCustomEditor(int.class, new CustomNumberEditor(int.class, true));
//		binder.registerCustomEditor(int.class, new com.chezhujie.www.core.IntegerEditor());
//		binder.registerCustomEditor(Integer.class, new com.chezhujie.www.core.IntegerEditor());
//        binder.registerCustomEditor(long.class, new CustomNumberEditor(long.class, true));
//		binder.registerCustomEditor(long.class, new LongEditor());
//		binder.registerCustomEditor(double.class, new DoubleEditor());
//		binder.registerCustomEditor(float.class, new FloatEditor());
//		binder.registerCustomEditor(long.class, new com.chezhujie.www.core.IntegerEditor());
//		binder.registerCustomEditor(double.class, new com.chezhujie.www.core.IntegerEditor());
//		binder.registerCustomEditor(float.class, new com.chezhujie.www.core.IntegerEditor());
	}
}

